< previous page page_15 next page >

Page 15
12180-0015a.gif
Figure 1.1.
This is an example of a class module in Visual Basic.
The keyword Public means that the member is accessible to all modules, both within the project and in external projects. If you don't want any members to be public outside the project, you can insert the following line of code in the General Declarations section of the class module:
Option Private
The keyword Private means that the member is accessible only by other members within the class module. This does not mean that you can't pass the value of the private property to an external module via a public property or method. For instance, let's say you have a class called CheckingAccount with the members in Listing 1.1.
LISTING 1.1. MEMBERS OF THECheckingAccountCLASS.

9f8044bafea36a1f728739c0bb58ef4c.gif
 1:  General Declarations
 2: Private mvarpAccountNumber As String
 3:
 4: Public Property Get pAccountNumber () As String
 5:     pAccountNumber = mvarpAccountNumber
 6: End Property
 7:
 8: Public Property Let pAccountNumber (ByVal sNewAccountNumber As String)
 9:     mvarpAccountNumber = sNewAccountNumber
10: End Property

 
< previous page page_15 next page >

If you like this book, buy it!